home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / BrainRulers / Source / DragPSView.h < prev    next >
Text File  |  1995-06-12  |  1KB  |  33 lines

  1. // DragPSView.m
  2. // A simple view class that responds to mouseDown event by 
  3. // opening a stream and sending a message to a 'streamProvider'
  4. // to draw postscript code into the stream.  It then writes the
  5. // stream back to the file (DRAGGEDFILENAME) and invokes the view
  6. // method dragFile:fromRect:slideBack:event:
  7. // You must connect the streamProvider outlet to an object that 
  8. // responds to writeToStream: by writing the contents of the file
  9. // represented by the icon to the given stream.
  10. // DragPSView.h provides an interface to a 'streamProvider'
  11. // category (of the Object class) with this method.
  12. // Note: This class does not remove DRAGGEDFILENAME.
  13. // DragPSView composites an image (IMAGENAME) to draw itself.
  14.  
  15. #import <appkit/View.h>
  16. #define DRAGGEDFILENAME "/tmp/PS_Image.ps"
  17. #define IMAGENAME "smallPSicon"
  18.  
  19. @interface DragPSView:View
  20. {
  21.     // provides the PSstream of image to be dragged
  22.     id    streamProvider;        
  23. }
  24.  
  25. - drawSelf:(NXRect *)rects :(int)rectCount;
  26. - mouseDown:(NXEvent *)theEvent;
  27.  
  28. @end
  29.  
  30. @interface Object(streamProvider)
  31. - writeToStream:(NXStream *)stream;
  32. @end
  33.